package com.sdkx.wear_os.retrofit.api

import com.sdkx.wear_os.retrofit.*
import com.sdkx.wear_os.retrofit.response.BaseResponse
import okhttp3.MultipartBody
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.*

/**
 * 请求api
 */
interface ApiService {

    /** 上传文件*/
    @Multipart
    @POST("v1/bus/file/upload")
    suspend fun upLoadFile(@Part file: MultipartBody.Part): BaseResponse<Bean>

    /**上传多文件*/
    @Multipart
    @POST("v1/bus/file/uploads")
    suspend fun upLoadsFile(@Part file: List<MultipartBody.Part>): BaseResponse<List<Bean>>

    /**下载文件*/
    @Streaming
    @GET
    suspend fun downloadFile(@Url url: String): Response<ResponseBody>

    /** 账号加密码方式登录*/
    @POST("v1/login")
    suspend fun login(@Body body: RequestBody): BaseResponse<String>

    /**退出登录*/
    @POST("v1/logout")
    suspend fun logout(): BaseResponse<String>

    /**修改密码**/
    @POST("v1/bus/user/password")
    suspend fun updateLoginPasswordByPhone(@Body body: RequestBody): BaseResponse<String>

    /**关于我们*/
    @GET("v1/bus/platformConfig/aboutus?platformType=1")
    suspend fun aboutUs(): BaseResponse<UserInfo>

    /** 升级*/
    @GET("v1/appDownloadConf/getAndroid")
    suspend fun getAndroidRvVersion(): BaseResponse<Bean>

    /** 个人信息*/
    @GET("v1/bus/user/getInfo")
    suspend fun getLoginUserInfo(): BaseResponse<UserInfo>

    /** 个人信息修改*/
    @POST("v1/bus/user/updateInfo")
    suspend fun updateInfo(@Body body: RequestBody): BaseResponse<String>

    /** 天气*/
    @GET("v1/bus/weather/getWeatherByToday")
    suspend fun getWeatherByToday(): BaseResponse<Bean>

}